1. Field of the Invention
The present invention generally relates to apparatuses and methods for encoding/decoding images, computer-readable programs for encoding/decoding images, and image recording media storing such programs.
2. Description of the Related Art
The improvements in resolution of digital cameras and scanners that have been made over the years have led to an increasing demand for capabilities to handle high-resolution still images. Diverse functions are required of image compression/expansion technologies for facilitating the handling of high-resolution still images. One of the currently most popular image compression/expansion algorithms for high-resolution still images is JPEG (Joint Photographic Experts Group; ISO/IEC10918-1). In recent years, image compression/expansion algorithms that employ discreet wavelet transform (“DWT”) for frequency transform are increasingly being used. One example is the JPEG 2000 encoding technology (ISO/IEC15444-1).
One feature of the JPEG 2000 encoding technology (hereafter referred to as “JPEG 2000”) lies in its resolution scalability. Resolution scalability is utilized when one desires to view an image by transforming it to a desired image size. The displayed image size of a high-resolution still image may be determined by the resolution (dot pitch) and size of the digital camera or scanner at the time of reading a signal. Once the signal is transformed into data adapted to a predetermined still image format, the image size remains constant unless the data is subjected to a transform process. However, a user may want to view the image at various view sizes or resolutions. For example, the resolution of an LCD monitor installed on a digital camera may greatly differ from the resolution of a display of a personal computer on which the user may wish to view an image taken with the digital camera.
When image data that has been encoded by an encoding system without resolution scalability, such as JPEG, is to be displayed at a desired size, the entire codes need to be once decoded to obtain pixel data, i.e., a bit map, before an enlarging or reducing process can be performed on the data.
Japanese Laid-Open Patent Application No. 2003-189093 discloses a technology relating to an image processing apparatus that correctly distinguishes a character edge and a profile edge of a subject in a photograph region. An appropriate process can be then performed on the individual regions so that a high-quality output image can be obtained.
In contrast, when displaying code data encoded by JPEG 2000 at a reduced size, only a part of the code data can be subjected to a decoding process to generate a bit map. Thus, memory required for the decoding process can be reduced, and the processing time required for the decoding process can also be reduced. Such a decoding process performed on a part of code data to obtain a decoded image with a resolution smaller than that of the original image is hereafter referred to as a “reductive decoding”.
In a case of a high resolution black and white image, or when a character region is desired to be saved as monochromatic data separately from the background region, a binary original image is often encoded. This is because binary data, compared with multivalued data, requires less bits for representing a single pixel, so that the total volume of data that needs to be encoded can be reduced.
However, when the binary image is frequency-transformed and then its coefficient data is encoded to generate code data, a problem occurs that discontinuation of thin lines appears upon reductively decoding the code data back to pixel data. This is due to the frequency transform in the process of generating the code data. For example, in JPEG 2000, during the wavelet transform for the lossless encoding of a binary image, a rounding process is performed in order to obtain integers of wavelet coefficients. Thereafter, the data is downsampled at the intervals of two pixels, i.e., at every other pixel. Thus, while there are no problems in regions where continuous pixel values continue, black pixels may be eliminated by the aforementioned rounding process and downsampling in a region in which black thin lines exist among white pixels, for example, due to the scarcity of continuous pixel values, thus leaving the white pixels alone. Such problem is not considered in the aforementioned document.
The above problem also occurs when code data encoded by an encoding method without resolution scalability, such as JPEG or GIF, is decoded and later displayed by reducing its size at the nearest-neighbor points. The discontinuation or severing of the thin lines may be corrected by performing a smoothing process on the original image based on an algorithm such as linear interpolation (such as bi-linear interpolation) or three-dimensional interpolation (such as bi-cubic interpolation).
However, in the case of code data generated by JPEG 2000, when a smoothing process is performed by using all of the data for an image size corresponding to the original image upon reductive decoding, code data with higher resolution than the resolution of the displayed image also needs to be decoded. As a result, the advantage of reductive decoding decreases.